name: Generate Sponsors README

on:
  workflow_dispatch:
  schedule:
    - cron: '0 */12 * * *'

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout 🛎️
        uses: actions/checkout@v3

      - name: Generate Sponsors 💖
        uses: JamesIves/github-sponsors-readme-action@v1
        with:
          token: ${{ secrets.README_UPDATER_PAT }}
          file: 'README.md'
          minimum: 2500
          maximum: 99999

      - name: Deploy to GitHub Pages 🚀
        uses: JamesIves/github-pages-deploy-action@v4
        with:
          branch: master
          folder: '.'
          token: ${{ secrets.README_UPDATER_PAT }}
